<?php

require_once("../conexion/conexion.php");

$query = "";
$CodUsu = $_GET['CodUsu'];
$CodPer = $_GET['CodPer'];
$TipUsu = $_GET['TipUsu'];
$NomUsu = $_GET['NomUsu'];
$ApeUsu = $_GET['ApeUsu'];
$TipDoc = $_GET['TipDoc'];
$NumDoc = $_GET['NumDoc'];
$GenUsu = $_GET['GenUsu'];
$CorrUsu = $_GET['CorrUsu'];
$DepUsu = $_GET['DepUsu'];
$MunUsu = $_GET['MunUsu'];
$EstUsu = $_GET['EstUsu'];
$NickUsu = $_GET['NickUsu'];
$DesUsu = $_GET['DesUsu'];
$HabVal = $_GET['HabVal'];

$UsuTipIn = $_GET['UsuTipIn'];
$UsuTipEx = $_GET['UsuTipEx'];
$InsCap = $_GET['InsCap'];
$InsEmp = $_GET['InsEmp'];
$strXml = $_GET['strXml'];



if ($TipUsu == 2)
{
    $query = "CALL SP_UPDATE_USUARIO('$CodPer','".$CodUsu."','".$TipUsu."','".$NomUsu."','".$ApeUsu."',NULL, NULL,
          NULL,NULL,NULL,'".$EstUsu."','".$NickUsu."','".$DesUsu."','".$HabVal."',
          '".$UsuTipIn."','".$UsuTipEx."','".$InsCap."','".$InsEmp."', '".$strXml."')";
}
else
{
$query = "CALL SP_UPDATE_USUARIO('$CodPer',".$CodUsu.",'".$TipUsu."','".$NomUsu."','".$ApeUsu."','".$TipDoc."','".$NumDoc."',
          '".$GenUsu."','".$CorrUsu."','".$MunUsu."','".$EstUsu."','".$NickUsu."','".$DesUsu."','".$HabVal."',
          '".$UsuTipIn."','".$UsuTipEx."','".$InsCap."','".$InsEmp."', '".$strXml."')";
}
 $result=mysql_query($query);
    
    if (!$result) 
        {
           die ("Invalido: " . mysql_error());
        }
    else
        {
             echo "OK";
        }

?>
